现在让我们来检查一下猜测的每个颜色和位置是否完全匹配。
- 添加一个 Loop with Range。将计数器更改为 peg_num ,范围更改为 4。
- 使用 if else 检查索引 [peg_num]处的guess 是否等于 [peg_num]处的 code。
- 如果相等,则添加一个名为 marker 的 "black" Circle ,带有 x 和 y 坐标,直径为 15。
- 如果相等,将 guess[peg_num]Append 到 colors_matched 列表。
To navigate the page using the TAB key, first press ESC to exit the code editor.